package tp4;
import static org.junit.Assert.*;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;


public class TESTabin {
	private static  Abin<String> a;
	@BeforeClass
	public static void setUpBeforeClass() throws Exception {
		
		noeudAbin<String> n4  = new  noeudAbin<String>("4");
		noeudAbin<String> n6  = new  noeudAbin<String>("6");
		n6.setDroite(n4);
		noeudAbin<String> n3  = new  noeudAbin<String>("3");
		noeudAbin<String> n1  = new  noeudAbin<String>("1");
		n1.setDroite(n3);
		n1.setGauche(n6);
		a = new  Abin<String>(n1);
	}

	@AfterClass
	public static void tearDownAfterClass() throws Exception {
	}

	@Before
	public void setUp() throws Exception {
	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void test() {


		Integer[] tas = new Integer[]{1,2,3,4,5,6,7,8,9,10};
		String test2 = "Abin [n= n [v=1, g=Abin [n= n [v=2, g=Abin [n= n [v=4, g=Abin [n= n [v=8, g=Abin [n=null], d=Abin [n=null]]], d=Abin [n= n [v=9, g=Abin [n=null], d=Abin [n=null]]]]], d=Abin [n= n [v=5, g=Abin [n= n [v=10, g=Abin [n=null], d=Abin [n=null]]], d=Abin [n=null]]]]], d=Abin [n= n [v=3, g=Abin [n= n [v=6, g=Abin [n=null], d=Abin [n=null]]], d=Abin [n= n [v=7, g=Abin [n=null], d=Abin [n=null]]]]]]]";
		 Abin<Integer>  a2 = new Abin<Integer>(tas);
		 assertEquals(test2, a2.toString());

		
	}

}
